#ifndef SCENE_H
#define SCENE_H

#include <GL/gl.h>
#include <vector>
#include <iostream>

#include "Object3D.h"
#include "Camera.h"
#include "Types.h"

using namespace std;

class Scene {

	private :
                int n_objects;
		/** Objects of the scene
		** Index starting in 0 */
		vector<Object3D *> objects;
		/** Camera */
		Camera *cam;
                
	public :

		Scene (Camera *cam);
		Scene (Scene scene,char *ruta);
		~Scene ();

		/* Selection issues */
		/*import orj*/
		void importar(char *ruta);
		/** \brief Add a new object to scene
		* \param o : new object
		* \return : index of the new object */
		GLuint add_object (Object3D *o);
		/** \brief Delete object n from scene
		* \param n : index of the object to delete */
		void delete_object (GLuint n);
		/** \brief Select all objects
		* \return number of objects selected */
		GLuint select_all ();
		/** \brief Deselect all objects */
		void deselect_all ();
		/** \brief Make inverse selection
		* \return number of objects selected */
		GLuint select_inverse ();
		/** \brief Select n'th object 
		* \param n : index of the object in vector
		* \return : 0 if exists, 1 if doesnt */
		GLuint select_object (GLuint n);        
		/** \brief Deselect n'th object
		* \param n : index of the object in vector */
		void deselect_object (GLuint n);                

		/* Editing issues */

		/** \brief Edit n'th object
 		* \param n : index of the object */ 
		GLuint edit_object (GLuint n);
		/** Dont edit any object */
		void dont_edit ();

		/* Basic operations */
		
		/** \brief Move selected objects to determined position
 		 * \param pos : new position of the center of mass */ 
		void move (Vertex3D pos);	
		/** \brief Scale selected objects 
 		 * \param factor : scale factor 
 		 * \param axis : scale the object restricted to axis */
		void scale (GLdouble factor, TAxis axis);
		/** \brief Rotate selected objects
 		 *  \param degree : degrees to rotate
 		 *  \param axis : axis to rotate around */
		void rotate (GLdouble degree, TAxis axis); 
		/** \brief Get the Camera*/
		Camera *get_cam();
		vector<Object3D*> get_objects();
		/** Draw scene */
		void draw ();

};

#endif

